<?php
/**
 * @package    Delcampe Community
 *
 * @copyright Sebastien Delcampe
 * @license Please, don't read or copy
 * @author afernando
 *
 * @version 1.0
**/
?>
<table width="660" border="0" cellspacing="2" cellpadding="1">
  <th colspan="5" align="left"><h2><?php echo $this->title; ?></h2></th>
  <tr>
    <td width="300" align="left" valign="top"><b>Translation Key</b></td>
    <td width="90" align="center" valign="top"><b>en</b></td>
    <td width="90" align="center" valign="top"><b>fr</b></td>
    <td width="90" align="center" valign="top"><b>de</b></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>  

<?php 


?> 
<?php
foreach ($this->translate_entries as $entry):  
  $id = $entry['id'];
  $en = $entry['lan_en']; 
  $fr = $entry['lan_fr'];
  $de = $entry['lan_de'];
  $key_text = $entry['keyText'];
  
  if(isset($id) && $en != null)
  {
    $img_en = "<a href=".$this->url(
    array(
        'controller' => 'translate',
        'action'     => 'version',
        'id'		 => array('id' => $id ),
        'lang'		 => array('lang' => 'en' )
    ), 
    'default', 
    true)."><img src='/images/tick.jpg' width='18' height='17' border='0' /></a>";
  } else {
    $img_en = "<a href=".$this->url(
    array(
        'controller' => 'translate',
        'action'     => 'edittranslate',
        'id'		 => array('id' => $id ),
        'lang'		 => array('lang' => 'en' )
    ), 
    'default', 
    true)."><img src='/images/delete.jpg' width='18' height='17' border='0' /></a>";
  }
  
  if(isset($id) && $fr != null)
  {
    $img_fr = "<a href=".$this->url(
    array(
        'controller' => 'translate',
        'action'     => 'version',
        'id'		 => array('id' => $id ),
        'lang'		 => array('lang' => 'fr' )
    ), 
    'default', 
    true)."><img src='/images/tick.jpg' width='18' height='17' border='0' /></a>";
  } else {
    $img_fr = "<a href=".$this->url(
    array(
        'controller' => 'translate',
        'action'     => 'edittranslate',
        'id'		 => array('id' => $id ),
        'lang'		 => array('lang' => 'fr' )
    ), 
    'default', 
    true)."><img src='/images/delete.jpg' width='18' height='17' border='0'/></a>";
  }
  
  if(isset($id) && $de != null)
  {
    $img_de = "<a href=".$this->url(
    array(
        'controller' => 'translate',
        'action'     => 'version',
        'id'		 => array('id' => $id ),
        'lang'		 => array('lang' => 'de' )
    ), 
    'default', 
    true)."><img src='/images/tick.jpg' width='18' height='17' border='0' /></a>";
  } else {
    $img_de = "<a href=".$this->url(
    array(
        'controller' => 'translate',
        'action'     => 'edittranslate',
        'id'		 => array('id' => $id ),
        'lang'		 => array('lang' => 'de' )
    ), 
    'default', 
    true)."><img src='/images/delete.jpg' width='18' height='17' border='0' /></a>";
  }
   
?>
  <tr>
    <td><?php echo $key_text; ?></td>
    <td align="center"><?= $img_en; ?></td> 
    <td align="center"><?= $img_fr; ?></td>
    <td align="center"><?= $img_de; ?></td>       
  </tr>
<?php
endforeach;
?>
</table>